package com.appspot.codelab.docs.client.repository;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of the GData remote service.
 */
public interface RepositoryServiceAsync {

  void projectExists(String project, AsyncCallback<Boolean> callback);
	  
  void createSourceDirectory(String project, String path, String username, String password, AsyncCallback<Boolean> callback);

  void uploadSourceFile(String project, String path, String username, String password, String contents, AsyncCallback<Boolean> callback);
	   
  void uploadProjectFile(String project, String path, String username, String password, String contents, String summary, String[] labels, AsyncCallback<Boolean> callback);
  
  void deleteSourceFile(String project, String path, String username, String password, AsyncCallback<Boolean> callback);
  
  void renameSourceFile(String project, String path, String newPath, String username, String password, AsyncCallback<Boolean> callback);

  void getSourceFileContents(String project, String path, String revision, AsyncCallback<String> callback);
  
  void getSourceDirectory(String project, String path, String revision, AsyncCallback<String> callback);

  void getUser(AsyncCallback<RepositoryUser> callback);
  
  void getProject(String projectName, AsyncCallback<RepositoryProject> callback);
  
  void putProject(String projectName, String projectToken, AsyncCallback<RepositoryProject> callback);

  void logout(AsyncCallback<String> callback);
  
}
